package echat.future.cn.echat.my.adapter;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import echat.future.cn.echat.R;
import echat.future.cn.echat.my.bean.ImageBean;
import echat.future.cn.echat.my.utils.ImageLoadUtils;

public class ArtSelecotrAdapter extends BaseMultiItemQuickAdapter<ImageBean,BaseViewHolder> {

    /**
     * Same as QuickAdapter#QuickAdapter(Context,int) but with
     * some initialization data.
     *
     * @param data A new list is created out of this one to avoid mutable list
     */
    public ArtSelecotrAdapter(List<ImageBean> data) {
        super(data);
        addItemType(0, R.layout.item_add2);
        addItemType(1, R.layout.item_image);
    }

    @Override
    protected void convert(BaseViewHolder helper, ImageBean item) {
        if(item.getItemType() == 1){
            ImageLoadUtils.loadImage(mContext,item.getImg(),helper.getView(R.id.pic));
            helper.addOnClickListener(R.id.delete);
        }else{
            helper.addOnClickListener(R.id.add);
        }
    }

}
